@forelse($categories as $category)
    <tr>
        <td><input type="checkbox"/></td>

        <td>{{$category->id}}</td>
        <td>{{ str_repeat('----', $level) }} {{ $category->name }}</td>
        <td>{{$category->display_name}}</td>
        <td>{{ $category->articles()->count() }}</td>
       {{-- <td class="am-hide-sm-only">{{$category->sort}}</td>--}}
        <td class="am-hide-sm-only">{{$category->updated_at}}</td>
        <td>
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <a  href="{{route('admin.category.edit', [$category->id])}}"  class="am-btn am-btn-default am-btn-xs am-text-secondary">
                    <span class="am-icon-pencil-square-o"></span>编辑</a>
                    <button  data-item-id="{{ $category->id }}" data-post-url="{{route('admin.category.destroy', [$category->id]) }}"  class="op-delete am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">
                        <span class="am-icon-trash-o"></span> 删除</button>
                </div>
            </div>
        </td>
    </tr>
    @if($category->children()->count() > 0)
        @include('admin.site.category.category-index-list', ['categories' => $category->children, 'level' => $level + 1 ])
    @endif
@empty
    <tr>
        <td colspan="8">
            没有分类，<a href="{{route('admin.category.create')}}">请添加</a>
        </td>
    </tr>
@endforelse


